<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Jialeo\LaravelSchemaExtend\Schema;

class AddLeaseContractToOpenShopSiteLocationsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('open_shop_site_locations', function (Blueprint $table) {
            $table->unsignedInteger('signatureTime')->comment('合同-签署时间')->default(0);
            $table->unsignedInteger('ctSubmitTime')->comment('合同-提交时间')->default(0);
            $table->unsignedTinyInteger('ctRentType')->comment('合同-计租方式')->default(0);
            $table->unsignedInteger('ctFixedRent')->comment('合同-固定租金')->default(0);
            $table->double('ctRemind', 7,4)->comment('合同-提点百分比')->default(0);
            $table->unsignedTinyInteger('ctRentPaymentCycle')->comment('合同-租金支付周期')->default(0);
            $table->string('ctDeposit', 7)->comment('合同-押金')->default('');
            $table->string('ctLeaseTerm', 7)->comment('合同-租期')->default('');
            $table->string('ctRentFreePeriod', 7)->comment('合同-免租期')->default('');
            $table->string('ctPropertyFee', 7)->comment('合同-物业费')->default('');
            $table->string('ctMobilizationFee', 7)->comment('合同-进场费')->default('');
            $table->string('transferFee', 7)->comment('转让费')->default('');
            $table->string('ctTransferFee', 7)->comment('合同-转让费')->default('');
            $table->string('ctBond', 7)->comment('合同-保证金')->default('');
            $table->string('ctManageFee', 7)->comment('合同-管理费')->default('');
            $table->string('ctSponsorshipFee', 7)->comment('合同-赞助费')->default('');
            $table->string('ctPromotionFee', 7)->comment('合同-推广费')->default('');
            $table->string('ctOtherFee', 7)->comment('合同-其他费用')->default('');
            $table->text('expenseDifferDesc')->comment('费用不一致说明');
            $table->text('leaseFiles')->comment('租赁合同文件');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('open_shop_site_locations', function (Blueprint $table) {
            $table->dropColumn('signatureTime');
            $table->dropColumn('ctRentType');
            $table->dropColumn('ctSubmitTime');
            $table->dropColumn('ctFixedRent');
            $table->dropColumn('ctRemind');
            $table->dropColumn('ctRentPaymentCycle');
            $table->dropColumn('ctDeposit');
            $table->dropColumn('ctLeaseTerm');
            $table->dropColumn('ctRentFreePeriod');
            $table->dropColumn('ctPropertyFee');
            $table->dropColumn('ctMobilizationFee');
            $table->dropColumn('ctTransferFee');
            $table->dropColumn('ctBond');
            $table->dropColumn('ctManageFee');
            $table->dropColumn('ctSponsorshipFee');
            $table->dropColumn('ctPromotionFee');
            $table->dropColumn('ctOtherFee');
            $table->dropColumn('expenseDifferDesc');
            $table->dropColumn('leaseFiles');
            $table->dropColumn('transferFee');
        });
    }
}
